@extends('front.layout')
@section('title','首页')
@section('index')
    <li><a class="current"href="/">首页</a></li>
    <li><a href="/conf">名家讲堂</a></li>
    <li><a href="/expert">名家风采</a></li>
    <li><a  href="/review">往期视频</a></li>
@endsection
@section('content')

    <div class="main">
    <div class="index_top clearfix">
        <div class="index_left">
            <div class="index_left_bg"><img src="/assets/images/last_time_bg.jpg" /></div>
            <div class="index_left_body">


                @if($counts>0)
                    <?php
                    //php的时间是以秒算。js的时间以毫秒算
                    date_default_timezone_set("Asia/Hong_Kong");//地区
                    $time=strtotime($zvideo->start_at);
                    $current_time=time();//现在的时间
                    $remain = $time-$current_time;//剩余的时间
                    $day= intval($remain/86400);;//天
                    $remains = $remain%86400;
                    $hour = intval($remains/3600);
                    //计算分钟数
                    $remain1 = $remain%3600;
                    $minute = intval($remain1/60);
                    //计算秒数
                    $second = $remain%60;
                    ?>
                    <script language="JavaScript">
                        let runtimes = 0;
                        function GetRTime(){
                            let nMS = <?=$remain?>*1000-runtimes*1000;
                            let nD=Math.floor(nMS/(1000*60*60*24));
                            let nH=Math.floor(nMS/(1000*60*60))%24;
                            let nM=Math.floor(nMS/(1000*60)) % 60;
                            let nS=Math.floor(nMS/1000) % 60;
                            document.getElementById("RemainH").innerHTML=nD;
                            document.getElementById("RemainH").innerHTML=nH;
                            document.getElementById("RemainM").innerHTML=nM;
                            document.getElementById("RemainS").innerHTML=nS;
                            runtimes++;
                            setTimeout("GetRTime()",1000);
                        }
                        window.onload=GetRTime;
                    </script>
                    @if($current_time<$time)
                        <div class="before">
                            <div class="last_time">
                                <span class="time1"><strong id="RemainD">00</strong></span>
                                <span class="time2"><strong id="RemainH">00</strong></span>
                                <span class="time3"><strong id="RemainM">00</strong></span>
                                <span class="time4"><strong id="RemainS">00</strong></span>
                            </div>
                            <a class="class_href" href="#"></a>
                        </div>
                        @else

                    <!--会议进行中-->
                        <input type="hidden" id="url" value="/review/review_info/{{$zvideo->id}}">
                        <div id="meeting" class="meeting" >
                            <a href="javascript:Pop_on_input()">
                                <img src="assets/images/online_classing.png" />
                            </a>
                        </div>

                        @endif


                    <div class="left_share">
                        <span>分享到：</span>
                        <a href="javascript:void(0)" onclick="erweima()"><img src="/assets/images/icon_weixin.jpg" /></a>
                    </div>
            </div>
        </div>
        <div class="index_right">
            <div class="title_box">专家介绍</div>
            <div class="index_right_list">
                <div class="index_right_ship clearfix">
                    <div class="index_right_img">
                        <a href="/expert/info/{{$experts->id}}"><img src="{{$experts->image}}" /></a>
                    </div>
                    <div class="index_right_txt">
                        <p>专家: {{$experts->name}}</p>
                        <p>职位: {{$experts->zc}}</p>
                        <p>医院: {{$experts->hos}}</p>
                        <p><a href="/expert/info/{{$zvideo->expert_id}}">详细>></a></p>
                    </div>
                </div>

                <div class="index_right_more"><a href="/expert">more+</a></div>
            </div>
        </div>
    </div>



    <div class="review">
        <div class="title_box">精彩回顾</div>
        <div class="review_list">
            <div class="one_line clearfix">
                <div class= " review_ship " >
                    <div class="review_ship_img">
                        <a href="/review/review_info/{{$zvideo->id}}">
                            <img src="assets/test_images/r1.jpg" />
                        </a>
                    </div>
                    <div class="review_ship_txt">
                        <div class="review_ship_title break"><P>标题：{{$zvideo->title}}</div>
                        <div class="review_ship_intro clearfix">
                            <div class="review_ship_left">
                                <p>专家：<a href="/expert/info/{{$zvideo->expert_id}}">{{$experts->name}}</a></p>
                                <p>日期：<span class="txt_999">{{$zvideo->start_at}}</span></p>
                            </div>
                            <div class="review_ship_right">
                                <a class="info_btn" href="/review/review_info/{{$zvideo->id}}">查看详情</a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>
@else
    <!--会议结束-->

        <div class="end_title">会议已结束</div>
</div>
</div>
<div class="index_right">
    <div class="title_box">专家介绍</div>
    <div class="index_right_list">
        @foreach($experts as $v)
            <div class="index_right_ship clearfix">
                <div class="index_right_img">
                    <a href="/expert/info/{{$v->id}}"><img src="assets/test_images/e1.jpg" /></a>
                </div>
                <div class="index_right_txt">
                    <p>专家: {{$v->name}}</p>
                    <p>职位: {{$v->zc}}</p>
                    <p>医院: {{$v->yy}}</p>
                    <p><a href="/expert/info/{{$v->id}}">详细>></a></p>

                </div>
            </div>
        @endforeach
        <div class="index_right_more"><a href="/expert">more+</a></div>
    </div>
</div>
</div>
<div class="review">
    <div class="title_box">精彩回顾</div>
    <div class="review_list">
        @foreach($videos as $v)
            <div class="one_line clearfix">
                <div class= " review_ship " >
                    <div class="review_ship_img">
                        <a href="/review/review_info/{{$v->id}}">
                            <img src="assets/test_images/r1.jpg" />
                        </a>
                    </div>
                    <div class="review_ship_txt">
                        <div class="review_ship_title break"><P>标题：{{$v->title}}</div>
                        <div class="review_ship_intro clearfix">
                            <div class="review_ship_left">
                                <p>专家：<a href="/expert-info/{{$v->id}}">{{$v->name}}</a></p>
                                <p>日期：<span class="txt_999">{{$v->start_at}}</span></p>
                            </div>
                            <div class="review_ship_right">
                                <a class="info_btn" href="/review/review_info/{{$v->id}}">查看详情</a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        @endforeach
    </div>
</div>
@endif
</div>
    <div id="name_pop" class="export_pop" style="display:none">
        <div class="export_pop_top">
            <span>提示</span>
            <a href="javascript:Pop_close()" class="export_pop_close"></a>
        </div>
        <div class="export_pop_body">
            <div>请输入您的姓名：</div>
            <div class="export_name_input"><input id="nick_name" type="text" /></div>
            <div class="export_name_submit"><input type="button" class="btn blue_btn" value="确定" onclick="join_meeting()"/></div>
        </div>


        <div id="char_pop" class="chat_pop" style="display: none">
    <div id="char_close" class="chat_pop_top"><a onclick="Pop_close()" class="chat_pop_close"></a></div>
    <div class="chat_pop_body">
        <img src="/assets/images/share_ewm.jpg" />
        <p>使用微信扫一扫，并将网页分享给好友</p>
    </div>
</div>
<script>
    function erweima(){
        $.blockUI({
            message:$("#char_pop"),
            css:{border:'none'}
        });
    }
    function Pop_close(){
        $.unblockUI();
    }
    function Pop_on_input()
    {
        $.blockUI({
            message: $("#name_pop"),
            css:{border:'none' }
        });
    }


    function join_meeting()
    {
        var nick_name=$("#nick_name").val();

        var url=$("#url").val();
        if(nick_name=="")
        {
            alert("111");
            return;
        }

        url=url+"?nickName="+nick_name;
        window.open(url);
    }

    function nothing()
    {
    }

    function Pop_close()
    {
        $.unblockUI();
    }

    function quit_pop()
    {
        $("#cover").hide();
    }

</script>

@endsection
